<template>
    <ul>
        <li
            v-for="item in goodsList"
            :key="item.id"
            @click="
                LookDetail(item.id)
            "
        >
            <img v-lazy="item.list_pic_url" width="100%" />
            <div class="van-ellipsis">{{ item.name }}</div>
            <div class="price">{{ item.retail_price | RMBformat }}</div>
        </li>
    </ul>
</template>

<script>
export default {
    data() {
        return {};
    },
    props: ["goodsList"],
    methods: {
        LookDetail(val){
           this.$router.push({
                    name: 'Pruductdetail',
                    params: { id: val },
                })
                setTimeout(() => {
                    this.$router.go(0)
                    document.documentElement.scrollTop = 0
                }, 50);
        }
    }
};
</script>
 
<style lang = "less" scoped>
ul {
    padding: 0.1rem 2%;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    li {
        width: 49%;
        margin-bottom: 0.1rem;
        background: #fff;
        text-align: center;
        line-height: 0.3rem;
        .price {
            color: darkred;
        }
    }
}
</style>